import request from "@/utils/request";

export function getPromotions(params){
    return request({
        url: '/api/promotion-activity',
        method: 'get',
        params
    })
}

export function getSeckillActivity(activityId){
    return request({
        url: '/api/seckill-item/activity',
        method: 'get',
        params: {activityId}
    })
}

export function getSeckillItems(activityId, page, size){
    return request({
        url: '/api/seckill-item/items',
        method: 'get',
        params: {activityId, page, size}
    })
}

export function placeSeckillOrder(userId, activityId, skuId, quantity){
    return request({
        url: '/api/seckill-item/placeOrder',
        method: 'post',
        params: {userId, activityId, skuId, quantity}
    })
}

export function getComboActivity(activityId){
    return request({
        url: '/api/combo/activity',
        method: 'get',
        params: {activityId}
    })
}

export function getComboItems(activityId, page, size){
    return request({
        url: '/api/combo/items',
        method: 'get',
        params: {activityId, page, size}
    })
}

export function placeComboOrder(userId, activityId, comboId){
    return request({
        url: '/api/combo/placeOrder',
        method: 'post',
        params: {userId, activityId, comboId}
    })
}

export function getFullReductionActivity(activityId){
    return request({
        url: '/api/fullReduction/activity',
        method: 'get',
        params: {activityId}
    })
}

export function getFullReductionItems(activityId, page, size){
    return request({
        url: '/api/fullReduction/items',
        method: 'get',
        params: {activityId, page, size}
    })
}

export function placeFullReductionOrder(data){
    return request({
        url: '/api/fullReduction/placeOrder',
        method: 'post',
        data
    })
}
